import { createBrowserRouter } from 'react-router-dom'
import App from '../App'
const router = createBrowserRouter([
    {
        path: '/',
        element: <App></App>,
        children: [
            {
                path: 'login',
                async lazy() {
                    const { default: Login } = await import('../pages/login')
                    return {
                        element: <Login></Login>,
                    }
                }
            }, 
            {
                path: 'home',
                async lazy() {
                    const { default: Home } = await import('../pages/home')
                    return {
                        element: <Home></Home>,
                    }
                }
            }, {
                path: 'list',

                async lazy() {
                    const { default: List } = await import('../pages/list')
                    return {
                        element: <List></List>,
                    }
                }
            },
            {
                path: 'chart',

                async lazy() {
                    const { default: Chart } = await import('../pages/chart')
                    return {
                        element: <Chart></Chart>,
                    }
                }
            },
            {
                path: 'my',

                async lazy() {
                    const { default: My } = await import('../pages/my')
                    return {
                        element: <My></My>,
                    }
                }
            },
        ]
    }
])
export default router